home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Expert
/
Windows Expert.iso
/
database
/
winsql20.zip
/
README.DOC
< prev
next >
Wrap
Text File
|
1991-10-26
|
20KB
|
439 lines
General Information Page 1 of 8
Orion SQL For Windows
Release 2.0 - November 1991
GENERAL INFORMATION
Copyright (c) 1991 by Stellar Industries
All Rights Reserved
Release 2.0 Enhancements
Orion SQL For Windows Release 2.0 adds significant new
features:
***** Orion SQL Applications Programming Interface (API)
What is the Orion SQL API?
The Orion SQL API is a powerful tool that enables you,
the software developer, to have full access to a modern,
highly optimized ANSI standard SQL database manager: the
Orion Database Administrator. Your programs written in
any language which can access dynamic link libraries can
also access the Orion SQL API. These languages include
'C', 'C++', 'Visual Basic', 'Pascal' and most assemblers.
In fact, any program which can access the Microsoft
Windows environment can access the Orion SQL API.
Microsoft Windows itself is a dynamic link library.
The Orion SQL API is your gateway to modern database
technology. With a little more than a dozen functions
and only 4 data structures you can perform almost any
database task.
How does the Orion SQL API work?
"How is this done?" you might ask. Well, while the
Orion Database Administrator is sophisticated, complex
and fully optimized for maximum performance: the Orion
SQL API is simple and straight forward. The Orion SQL
API effectively buffers you from all the complex tasks of
parsing, query analysis, query optimization, query tree
construction, etc.
How do I link to the Orion SQL API?
When programming in 'C', you need to do only three things
to include all the power of SQL in your application:
General Information Page 2 of 8
1) When you link your object modules, include the
SQL.LIB import library along with libw.lib.
2) Include the SQL.H file (e.g. "#include <sql.h>") in
your source code.
3) Put the Orion Database Administrator (DBA.EXE) and
Orion SQL API (SQL.DLL) someplace where windows can
find them (usually in your windows directory).
When programming in 'Visual Basic', you need to do only
two things to include all the power of SQL in your
application:
1) Be sure to use the SQL.GBL file included with the
Orion SQL API. Note that the 'C' style prefixes
used with variable names (i.e. the 'n' in
nResultCode, and the 'sz' in szErrorMessage) are not
used with 'Visual Basic'.
2) Put the Orion Database Administrator (DBA.EXE) and
Orion SQL API (SQL.DLL) someplace where windows can
find them (usually in your windows directory).
How do I use the Orion SQL API?
Your program can login to the Orion Database
Administrator (SqlLogin), open a cursor (SqlCursorOpen)
and execute a query (SqlExecute). The query itself is
passed to the Orion SQL API as a simple text string. The
Orion SQL API does all the work for you. To get your
answers back (from a SELECT statement, for example) you
simply fetch them one at a time from the Orion SQL API.
You can fetch the first record (SqlFetchFirst), last
record (SqlFetchLast), next record (SqlFetchNext),
previous record (SqlFetchPrevious) or even a record at a
position you specify (SqlFetchPositioned).
You can have several cursors open at a time so that you
can access your data the way you want.
When you're all done, close your cursors (SqlCursorClose)
and log out (SqlLogout).
How can I check out my SQL statements?
You can check out your SQL statements using the Orion
Query Editor (QE.EXE) included with the Orion SQL API.
The Orion Query Editor allows you to type in the query
your program is going to send to the Orion SQL API and
have it execute right there in front of you. You'll get
all the results back on the screen where you can verify
it's what you expected. In fact, the Orion Query Editor
uses the Orion SQL API the same way your program does.
General Information Page 3 of 8
***** GENERAL PERFORMANCE IMPROVEMENT
Orion SQL For Windows Release 2.0 has significant
performance improvements over both Release 1.0 (about 6
fold) and Release 1.1 (about 2 fold) as evidenced by the
timings below. These queries are available to you in the
EXAMPLE.ZIP file.
+--------------------------------------------------------+
| release: | 1.0 | 1.1 | 2.0 |
|--------------------+-----------+-----------+-----------|
| QUERY15.SQL | 6.0 sec. | 1.4 sec. | 0.5 sec. |
|--------------------+-----------+-----------+-----------|
| QUERY16.SQL | 5.1 sec. | 1.9 sec. | 1.0 sec. |
+--------------------------------------------------------+
(80386 33MHz, 17 msec IDE disk, HYPERDISK disk cache)
***** OTHER ENHANCEMENTS
Significantly fewer records are written to the
transaction journal.
Unpacking and Installation Instructions
Orion SQL For Windows is provided as a single compressed file.
(WINSQL20.ZIP). The contents of WINSQL20.ZIP are defined in
the included PACKING.LST file.
Efficient operation of SQL For Windows requires that you use a
disk cache manager (such as MicroSoft's SMARTDRV.SYS). For
superior performance use a disk cache manager which also
caches disk writes, such as Norton Disk Cache (available with
Norton Utilities) or Hyperdisk Disk Accelerator (available as
shareware from HyperWare*). We at Stellar Industries
recommend Hyperdisk Disk Accelerator with which we observe a
three to six fold performance enhancement verses SMARTDRV.SYS.
Hyperdisk is available on many BBS's as HYDK421.ZIP.
Documentation for these disk cache managers should be
carefully reviewed. Utilizing SMARTDRV.SYS instead of
HyperDisk, the above timings become:
____________________
* HyperWare, RR#1 Box 91, Pall Mall, TN 38577; voice: (615)
864-6868; BBS: 8N1 (HST, V.32, V.22bis): (615) 864-6871
General Information Page 4 of 8
+--------------------------------------------------------+
| release: | 1.0 | 1.1 | 2.0 |
|--------------------+-----------+-----------+-----------|
| QUERY15.SQL | 20.0 sec. | 4.7 sec. | 1.8 sec. |
|--------------------+-----------+-----------+-----------|
| QUERY16.SQL | 22.0 sec. | 8.4 sec. | 5.9 sec. |
+--------------------------------------------------------+
Adding indices to tables greatly enhances performance. A
simple SELECT which extracts 5 records from a table of 3000
takes 10.6 seconds without an index. The same SELECT
statement takes only 0.6 seconds when there is an index on the
table.
While indices may be created at any time, we recommend that
you create indices immediately after you create their base
tables, otherwise CREATE INDEX has to read and rewrite all
data which is already in the table.
The importance of a good disk cache manager and thoughtful
database design including the use of indices (where
appropriate) cannot be over emphasized.
In order to properly install SQL For Windows on your computer
you will need to perform the following steps:
1) Use your favorite editor (NOTEPAD.EXE will suffice) to
insure that your 'CONFIG.SYS' file has the 'FILES=' MSDOS
parameter set to at least 30.
2) Move DBA.EXE, DBA.HLP, QE.EXE, QE.HLP, SQL.DLL and
SQL.HLP to the directory in which you keep windows
programs. This is usually the 'c:\windows' directory.
3) Make two new directories. One will be for the Orion
Database Administrator's files (we recommend naming it
'database'), the other will be for your queries and data
(we recommend naming it 'data'). You can use the MS-DOS
'mkdir' command to do this.
4) Unpack EXAMPLE.ZIP (contained within WINSQL20.ZIP). This
file contains both sample queries and an import file to
load some sample data into the database. We recommend
putting these files in your 'data' directory.
5) Use your favorite editor (NOTEPAD.EXE will suffice) to
modify the windows initialization file WIN.INI. This
file can usually be found in the 'c:\windows' directory.
Add the following lines:
[OrionDba]
AutoStart=1
DatabasePath=c:\database
DataFilePath=c:\data
General Information Page 5 of 8
FileNameDatabaseDump=c:\temp\orion.dmp
[OrionQe]
Acknowledge=1
DataFilePath=c:\data
OpenNew=1
UserName=SYSTEM
UserPassword=ORION
WarnOnClose=1
As DBA.EXE and QE.EXE automatically add some of these
lines if they do not already exist, be sure you are not
adding duplicate entries. If you edit WIN.INI before
running DBA.EXE or QE.EXE you don't have to worry.
These entries have the following meanings:
[OrionDba] Identifies a block of entries as
belonging to the Orion Database
Administrator.
AutoStart Set to '0' or '1'. When set to '1'
causes the Orion Database
Administrator to automatically start
the database as soon as you start the
program.
DatabasePath Set to the path you want the database
files to reside in. Make sure to
create this directory before starting
the Orion Database Administrator. We
recommend naming it 'database'.
DatafilePath Set to the path you want to use as
the default for import and export
operations. We recommend naming it
'data'.
FileNameDatabaseDump Set to the full file name of
the file you want the Orion Database
Administrator to use for the 'dump'
operation.
[OrionQe] Identifies a block of entries as
belonging to the Orion Query Editor.
Acknowledge Set to '0' or '1'. When set to '1'
causes the Orion Query Editor to
display an informational dialog box
every time a query completes.
DataFilePath Set to the path you want to use as
the default for file operations. We
recommend naming it 'data'.
General Information Page 6 of 8
OpenNew Set to '0' or '1'. When set to '1'
causes the Orion Query Editor to
automatically create a new 'pad' when
the Query Editor first starts.
UserName Set to 'SYSTEM'. This identifies the
default user name.
UserPassword Set to 'ORION'. This identifies the
default user password.
WarnOnClose Set to '0' or '1'. When set to '1'
causes the Orion Query Editor to
prompt the user for a file name
before closing a pad which contains
text not yet saved to disk.
SQL For Windows also relies upon the international date
and time settings. The Windows defaults are fine and you
can leave them alone. If you've changed them, don't
worry, time stamps are saved in binary and not converted
to international format until used for output. If you're
interested, we recommend the following settings:
[intl]
iDate=0
iTime=0
s1159=AM
s2359=PM
International date and time settings are most easily
changed via Microsoft's Windows Control Panel. Select
the "International" icon then click on either "date" or
"time".
6) Use Microsoft's Program Manager to create a new program
group:
a) select 'File', 'New'
b) select 'Program Group', 'OK'
c) Enter description: 'Orion', group file: 'ORION'
d) select 'OK'
7) Use Microsoft's Program Manager to create two new program
items:
a) select 'File', 'New'
b) select Program Item, 'OK'
c) Enter description: 'Dba', command line: 'DBA.EXE'
General Information Page 7 of 8
d) select 'OK'
e) select 'File', 'New'
f) select Program Item, 'OK'
g) Enter description: 'Qe', command line: 'QE.EXE'
h) select 'OK'
8) Start the Orion Database Administrator by clicking on the
'Dba' Icon in the Microsoft Program Manager. When the
Orion Database Administrator complains that it can't find
a database, click on "OK". Now select 'Toolbox' in the
main menu. Select the 'Install' entry, this will install
the database in the directory identified by the
'DatabasePath' setting described above.
9) At this point the database is fully installed. To run
some sample queries, see the section "Example Queries"
below.
10) If you're not going to use the Orion SQL Applications
Programming Interface (API), you may exit ('Exit' is in
the 'File' menu) the Orion Database Administrator.
11) If you intend to use the Orion SQL API for 'C' program
development: Move SQL.LIB into some directory where it
is accessible by your linker (usually c:\windev\lib).
Move SQL.H to a directory where it is accessible to the
compiler (usually c:\c\include). You will probably want
to read SQL.DOC. A sample application program is
included as EXAMPLEC.*. You ought to compile, link and
run it (the batch file EXAMPLEC.BAT is included to
accomplish this) to familiarize yourself with the Orion
SQL API.
12) If you intend to use the Orion SQL API for 'Visual Basic'
program development: A sample application program is
included. Move EXAMBLEB.* to a directory where you keep
your 'Visual Basic' programs (usually c:\vb). You ought
to compile and run EXAMPLEB to familiarize yourself with
the Orion SQL API. You will probably want to read
SQL.DOC.
Example Queries
You will probably want to run our examples to familiarize
yourself with the operation of SQL For Windows.
General Information Page 8 of 8
1) Start the Orion Database Administrator by clicking on the
'Dba' Icon in the Microsoft Program Manager. The
database ought to start automatically. If you didn't set
AutoStart=1 in the WIN.INI file, when the Orion Database
Administrator's window appears select 'Control' from its
menu. Select the 'Start' entry, this will start the
database.
2) Start the Orion Query Editor by clicking on the 'Qe' icon
in the Microsoft Program Manager. When the Orion Query
Editor's window appears select 'File' from its menu. Now
select the 'Open' entry and open the file CREATE.SQL.
This is one of the files contained in EXAMPLE.ZIP. When
its text appears in a pad select the menu commands
'Database', 'Execute' (or hit control/x). This query
creates the tables of the example database.
3) Now go to the Orion Database Administrator and select the
menu commands 'File', 'Import'. Select the file
EXAMPLE.DAT. This is one of the files contained in
EXAMPLE.ZIP. The 'Import' loads the data in EXAMPLE.DAT
into the tables you created with CREATE.SQL.
4) You can now execute any of the sample queries contained
in EXAMPLE.ZIP. Go to the Orion Query Editor, open a
file (for example QUERY01.SQL) and execute it. Files
which contain select statements will cause the Orion
Query Editor to open a new pad and place the results as
text into the new pad. You may then edit the data and/or
save it to a file using the 'File', 'Save As' commands.
5) To remove the sample data from the database just execute
the SQL 'drop table' statements in the DROP.SQL file.
6) You are now ready to write your own SQL statements and
create your own database.
Stellar Industries: (714) 861-7885
3335 S. Falcon Ridge Road
Diamond Bar, CA 91765